package com.mingqijia.gassafety.authority.api.req.manager;

import com.mingqijia.gassafety.shared.constant.Constants;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 变更密码
 * @author Damon S.
 * @version v0.2
 */
@Data
@ApiModel(value = "更改密码请求")
public class ChangePasswordReqDTO implements Serializable {

    @NotNull(message = "请输入账户名")
    @ApiModelProperty(value = "被修改密码的账户", required = true)
    private String username;

    @NotNull(message = "请输入新密码")
    @ApiModelProperty(value = "新密码(提交32位md5编码字符)-格式：md5(password+username)", required = true)
    @Pattern(regexp = Constants.REGEXP_PWD_MD5, message = "密码只能包含6-20位数字+小写字母+大写字母+特殊字符")
    private String newPassword;

    @NotNull(message = "请输入当前密码")
    @ApiModelProperty(value = "当前密码(提交32位md5编码字符)-格式：md5(password+username)", required = true)
    @Pattern(regexp = Constants.REGEXP_PWD_MD5, message = "密码只能包含6-20位数字+小写字母+大写字母+特殊字符")
    private String oldPassword;

    @NotNull(message = "请输入验证码")
    @ApiModelProperty(value = "验证码", required = true)
    private String captcha;
}
